﻿@model CharacterCreation.Business.ViewModels.VMCharacter

@{
    ViewBag.Title = "Details";
}

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
    
        @Html.HiddenFor(m => m.Id)

        <dl>
            <hr />

            <dt>@Html.LabelFor(model => model.Name)</dt>
            <dd>@Html.EditorFor(model => model.Name)</dd>
            
            <hr />

            <dt>@Html.LabelFor(model => model.Description)</dt>
            <dd>@Html.EditorFor(model => model.Description)</dd>

            <hr />
            
            <dt>@Html.LabelFor(model => model.Race)</dt>
            <dd>@Html.DropDownListFor(m => m.Race, new CharacterCreation.Business.Repositories.RaceRepository().RacesSelectListItem, new { @class = "race-select" })</dd>

            <hr />
        </dl>
        
        <!-- Character Statistics -->
        <h3>Statistics</h3>
        <table>
            <tr>
                <th>
                    Name
                </th>
                <th>
                    Statistic
                </th>
                <th>
                    Total XP
                </th>
                <th>
                    Information
                </th>
            </tr>

            @for (int i = 0; i < Model.Statistics.Count; ++i )
            {
                @Html.PartialFor(m => Model.Statistics[i], "CharacterStatistic_Details")
            }
        </table>
        <hr />
        
        
        <!-- Character Skills -->
        <h3>Skills</h3>
        @Html.ActionLink("Add", "AddSkill", new { characterId = Model.Id }, new { @class = "button" })
        <table>
            <tr>
                <th>
                    Name
                </th>
            </tr>

            @for (int i = 0; i < Model.Skills.Count; ++i )
            {
                @Html.PartialFor(m => Model.Skills[i], "CharacterSkill_Details")
            }
        </table>
        <hr />

        
        <input type="submit" value="Save" class="button" />
        @Html.ActionLink("Delete", "Delete", new { id = Model.Id }, new { @class = "button" })
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>